<!doctype html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-touch-fullscreen" content="yes">
    <title>KISSY Simple Tree</title>
    <link href="/kissy/build/css/dpl/base.css" rel="stylesheet"/>
    <link href="../../../src/button/assets/dpl.css" rel="stylesheet"/>
    <link href="../assets/dpl.css" rel="stylesheet"/>
</head>
<body>
<div class="container">

    <h1>KISSY Tree Performance Test</h1>

    <div id="treeContainer" style="width: 200px;margin: 20px 0;">

    </div>

    <hr/>


    <script src="/kissy/build/seed-debug.js"></script>
    <script src="/kissy/src/package.js"></script>
    <script>
        KISSY.use("tree,node", function (S, Tree,$) {
            var tree = new Tree({
                content: "淘宝网",

                expanded: true,
                // showRootNode:false,
                render: "#treeContainer"
            });

            tree.render();

            var i = 0;

            function run() {
                var start = (+new Date());
                for (var j = i; j < i + 5; j++) {
                    tree.addChild({
                        content: j + ''
                    });
                }
                i += 5;
                if(i>500){
                    return;
                }
                S.log('duration: ' + ((+new Date()) - start));
                setTimeout(run, 500);
            }

            run();
        });
    </script>
</div>
</body>
</html>